#include<stdio.h>
struct StudentsData
{
    int code;
    char name[20];
    int score1;
    int score2;
    int score3;
    int sum;
};

typedef struct StudentsData SD;

int main()
{
    int n;
    scanf("%d", &n);

    SD data[n];
    for(int i = 0; i < n; i ++)
    {
        scanf("%d %s %d %d %d", &data[i].code, data[i].name, &data[i].score1, &data[i].score2, &data[i].score3);
    }

    for(int i = 0; i < n; i ++)
    {
        data[i].sum = data[i].score1 + data[i].score2 + data[i].score3;
    }

    SD MAX = data[0];
    for(int i = 0; i < n; i ++)
    {
        if(data[i].sum > MAX.sum)
        {
            MAX = data[i];
        }
    }

    printf("%s %05d %d\n", MAX.name, MAX.code, MAX.sum);

    return 0;
}
